home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / bit / src / gluproto.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  5KB  |  136 lines

  1. /*
  2.  * $Id: gluproto.h,v 0.91 1994/02/20 00:53:37 zhao Pre-Release $
  3.  *
  4.  *. This file is part of BIT shareware package. After the two weeks of
  5.  *  free evaluation period, you are encouraged (required) to register
  6.  *  your copy for a small registration fee, which is $35 for personal use
  7.  *  and $50 for commercial, government and institutional use.
  8.  *
  9.  *  Copyright(c) 1993, 1994 by T.C. Zhao.
  10.  *  All rights reserved.
  11.  *
  12.  *  Permission to use, copy, and distribute this software in its entirety
  13.  *  for non-commercial purposes is hereby granted, provided that the
  14.  *  above shareware and copyright notices and this permission notice
  15.  *  appear in all copies and their documentation.
  16.  *
  17.  *  This software may be modified for your own use, but modified versions
  18.  *  may not be distributed without prior consent of the author.
  19.  *
  20.  *  This software is provided "as is" without expressed or implied
  21.  *  warranty of any kind.
  22.  *
  23.  *.
  24.  *
  25.  * Prototypes for gl(mouse,overlay,cursor) utilities
  26.  *
  27.  */
  28.  
  29. #ifndef BIT_GLUPROTO_H
  30. #define BIT_GLUPROTO_H
  31.  
  32. #include "utype.h"
  33.  
  34. extern void glu_init(void);
  35. extern int double_buffer_capable(void);
  36. extern int sml_capable(void);
  37.  
  38. /************ cursors   ****************/
  39.  
  40. #include "curdef.h"
  41.  
  42. /* mouse:                    */
  43. extern void get_mouse(int *, int *);
  44. extern void get_mouse_r2w(int *, int *);
  45. extern void set_mouse(int, int);
  46. extern void set_mouse_bounds(int, int, int, int);
  47. extern void reset_mouse_bounds(void);
  48.  
  49. /* other */
  50.  
  51. #define control_down (getbutton(CTRLKEY) || getbutton(RIGHTCTRLKEY))
  52. #define altkey_down  (getbutton(LEFTALTKEY) || getbutton(RIGHTALTKEY))
  53.  
  54. #define lmouse_down   getbutton(LEFTMOUSE)
  55. #define mmouse_down   getbutton(MIDDLEMOUSE)
  56. #define rmouse_down   getbutton(RIGHTMOUSE)
  57. #define mouse_down   (lmouse_down || mmouse_down)
  58.  
  59. /************* overlay/pupdraw stuff  ******************/
  60. extern void switch_frame_buffer(void);
  61. extern void clear_over_pup(void);
  62. extern int over_pup_colors;
  63. extern void op_mapcolor(int, int, int, int);
  64.  
  65. /**************** colormap ******************************/
  66. extern void set_colmap(int, pc_t *, pc_t *, pc_t *);
  67. extern void get_colmap(int, pc_t *, pc_t *, pc_t *);
  68. /* routines that draw simple geometric figures */
  69. extern void draw_line(float, float, float, float);
  70. extern void gl_rect(int, int, int, int, int, int);
  71. extern void gl_line(int, int, int, int, int, int);
  72. extern void gl_circ(int, int, int, int, int, int);
  73. extern void gl_tri(int, int, int, int, int, int);
  74. extern void gl_plus(int, int, int, int, int, int);
  75. extern void gl_hdist(int, int, int, int, int, int);
  76. extern void gl_star(int, int, int, int, int, int);
  77. extern void gl_arrow(int, int, int, int, int, int);
  78.  
  79. /* special routine that does polygons */
  80. extern void gl_poly(const int *, const int *, int, int);
  81. extern void gl_line_poly(const int *, const int *, int);
  82.  
  83. /* wrappers for GL routines that deals with different  pixel sizes */
  84. extern void clear_screen(long, int);
  85. extern void rect_clear(long, int, int, int, int);
  86. extern void Rectwrite(int, int, int, int, void *);
  87. extern void Rectcopy(int, int, int, int, int, int);
  88. extern void set_rectcp_ras(int);
  89. extern long Rectread(int, int, int, int, void *);
  90. extern void Color(rgba_t, int);
  91. extern void Color4(int *);
  92. extern void set_color_bk(void);
  93.  
  94. /****** moving rubbers bands etc *******************/
  95. extern void set_rubber_bounds(int, int, int, int, int);
  96. extern void set_rubber_center(int);
  97. extern void set_rubber_change_rate(int);
  98. extern void set_rubber_obj(int);
  99. extern void rubber_moveto(int *, int *, int *, int *);
  100. extern void rubber_hide(void);
  101. extern void rubber_finish(void);
  102. extern void rubber_show(int);
  103. extern void rubber_new(long, int, int, int, int, int);
  104. extern int get_max_rubber_obj(void);
  105. extern int rubber_on_screen(long *, int *);
  106. extern void set_rubber_info_cb(void (*)(int, int, int, int));
  107.  
  108. extern long rubber_cursor(long, short *, int *, int *, int, int, int);
  109. extern long rubber_info(long, short *, int *, int *, int *, int *, int, int);
  110. extern void end_rubber_info(void);
  111.  
  112.  
  113. /******* infomation about the rubber objects *****/
  114. extern void show_rect_ori(int, int);
  115. extern void show_rect_size(int, int);
  116. extern void show_rect_speed(int);
  117. extern void show_rect_all(int, int, int, int, int);
  118. extern void hide_rect_all(void);
  119.  
  120. /******* colors *******************/
  121. extern void set_color_wheel_max(int);
  122. extern void draw_color_wheel(int, int, int, int);
  123.  
  124. /***** misc. external routines *********/
  125. extern int is_valid_win(long);
  126. /*
  127.  * Macros related to graphics
  128.  */
  129. #include "mac.h"
  130. #ifndef RT_GMAC_H
  131. #define RT_GMAC_H
  132. #define WHERE_R2W(x,y,xo,yo) x = getvaluator(MOUSEX) - xo;\
  133.                              y = getvaluator(MOUSEY) - yo
  134. #endif
  135. #endif
  136.